package com.cdcas;

import java.lang.reflect.InvocationTargetException;

public class Factory {
    private Factory(){

    }
    public static <T> T getInstance(String className) {
        try {
            return (T) Class.forName(className).getDeclaredConstructor().newInstance();
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }

    }
}
